<form id="userseditfm" method="post" style="padding: 8px;">
    <input type="hidden" name="id" value="<?php echo $dataset->id;?>"/>
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" width="20%">用户名：</td>
            <td width="80%"><input name="username" value="<?php echo $dataset->username;?>" type="text" style="width:400px;" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="请输入用户名.." required="true"></td>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" width="20%">所属用户组：</td>
            <td width="80%">
                <SELECT name='roles_id' style="width:153px; height:25px;" size='1' class="forminput inputstyle">
                    <?php foreach($roles as $k=>$v):?>
                    <OPTION
                    <?php if($v->id==$dataset->roles_id):echo 'selected="selected"';endif;?> value="<?php echo $v->id;?>"><?php echo $v->name;?></OPTION>
                    <?php endforeach;?>
                </SELECT>
            </td>
        </tr>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" width="20%">密码：</td>
            <td width="80%"><input name="password" type="password" style="width:200px;" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="如不修改请留空.."></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" width="20%">重复密码：</td>
            <td width="80%"><input name="repassword" type="password" style="width:200px;" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox" placeholder="如不修改请留空.."></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" width="20%">状态：</td>
            <td width="80%"><input name="status" type="checkbox" class="textbox-prompt" value="1" <?php if($dataset->status==1):echo 'checked="checked"';endif;?> >激活</td>
        </tr>

    </table>
</form>

<script>
    $(function () {
        $('#usersupdatesubmit').click(function (data) {
            $('#userseditfm').form('submit', {
                url: '/admin/system/usersedit',
                success: function (data) {
                    var data = eval('(' + data + ')');
                    if (data.ret == 0) {
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        $('#userseditfm').form('clear');
                        $("#usersdlg").dialog('close');
                        $("#users").datagrid('reload');
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }
            });
        });
    });
</script>
